package org.nf.box.web.controller;

import lombok.RequiredArgsConstructor;
import org.nf.box.common.result.ResultVO;
import org.nf.box.service.AuthService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author lzp
 * @Date 2024-12-23
 */
@RestController
@RequiredArgsConstructor
public class LoginController extends BaseController{

    private final AuthService authService;

    @PostMapping("/login")
    public ResultVO<String> login(@RequestParam("accountNumber")String accountNumber,
                                  @RequestParam("password")String password) {
        String token = authService.auth(accountNumber, password);
        return success(token);
    }
}
